//=============================================================================
// 文件名:   main.js
// 创建人:   han.zw
// 创建日期:   2016-04-15
// @:  hanangjie@163.com

import React from "react"
import ReactDOM from "react-dom"
import UNIT from "../js/unit"
import Button from "../plugins/button"
import Table from "../plugins/table"
import DataFilter from "../js/datafilter"

var content=document.getElementById('content')
var search=document.getElementById('searchForm')
module.exports={
    demo:function(){
        ReactDOM.unmountComponentAtNode(content)
        ReactDOM.render(
            <div className="box box-primary">
                <div className="box-header">
                    <h3 className="box-title">表格演示</h3>

                </div>
                <div className="box-body">

                </div>
            </div>,
            content
        );
        UNIT.loadingClose();
    },
    tabledemo:function(){
        ReactDOM.unmountComponentAtNode(content)
        ReactDOM.render(
            <div className="box box-primary">
                <div className="box-header">
                    <h3 className="box-title">表格演示</h3>

                </div>
                <div className="box-body"  id="tableList">
                <Table
                    url={UNIT.domain+"admin/exhibition/topiclist/get.do"}
                    keyName="list"
                    datafilter="demoFilter"
                    headName="1序号12,名称,id"
                    params="id,name,status"/>
                </div>
            </div>,
            content
        );
    },
    tableSearch:function(){
        ReactDOM.unmountComponentAtNode(content);
        ReactDOM.unmountComponentAtNode(search);
        ReactDOM.render(
            <div className="box box-primary">
                <div className="box-header">
                    <h3 className="box-title">带搜索表格</h3>
                    <div className="box-tools">
                        <Button.search />
                    </div>
                </div>
                <div className="box-body" id="tableList">
                    <Table
                        url={UNIT.domain+"admin/blog/checklist/get.do"}
                        keyName="bloglist"
                        headName="序号,名称"
                        datafilter="searchFilter"
                        params="originid,originName"/>
                </div>
            </div>,
            content
        );
        ReactDOM.render(
                <section className="content" style={{minHeight: 'auto',paddingBottom:0}}>
                    <div className="box box-primary" style={{marginBottom: '-20px'}}>
                        <div className="box-body">
                            <form className="form-horizontal">
                                <Button.InputBox title="序号" name="status" />
                                <Button.submit
                                    keyName="bloglist"
                                    params="id,name,status"
                                    datafilter="searchFilter"
                                    filter="searchTest"
                                    url={UNIT.domain+"admin/blog/checklist/get.do"}
                                />
                            </form>
                        </div>
                    </div>
                </section>
                ,
            search
        );
    }
}

